export default function cancelWarning(callback) {
  this.$confirm("是否确定删除该数据，该操作不可逆，请谨慎操作", "提示", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      callback()
        .then((res) => {
          console.log(res);
          this.$message.success("删除成功");
        })
        .catch((err) => {
          console.log(err);
          this.$message.error("删除失败");
        });
    })
    .catch(() => {
      this.$message({
        type: "info",
        message: "删除取消",
      });
    });
}
